package com.yan.qing.bootoss.controller;

import com.alibaba.fastjson.JSON;
import com.yan.qing.bootoss.response.OssPolicyResultResponse;
import com.yan.qing.bootoss.service.AliOssService;
import com.yan.qing.bootoss.service.OssService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("oss")
@RestController
public class TestController {
    @Resource
    private OssService ossService;

    @GetMapping("/test")
    public String getPoliy(){
        OssPolicyResultResponse policy = ossService.policy("/test", "2023");
        return JSON.toJSONString(policy);
    }
}
